﻿<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
   <meta charset="utf-8" />
  	  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Dreamer Blog - 后台管理系统</title> 
    <!-- bootstrap 3.0.2 -->
    <link href="/resource/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="/resource/css/style.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="/resource/js/jQueryMessage/css/message.skin.css" />
</head>

<body>
	<div class="row">
	    <div class="col-md-12">
	    	<h1 class="panel-heading">修改变量</h1>
	        <!--breadcrumbs start -->
	        <ul class="breadcrumb">
	            <li><a href="#"><i class="fa fa-home"></i> Home</a></li>
	            <li><a href="#">Dashboard</a></li>
	            <li class="active">Current page</li>
	        </ul>
	        <!--breadcrumbs end -->
	    </div>
	</div>
	<div class="row">
		<div class="col-lg-12">
			<section class="panel">
				<div class="panel-body">
					<form class="col s12" id="form1" enctype="multipart/form-data" th:action="@{/admin/variable/update}" onsubmit="return validateForm();" method="post">
						<input type="hidden" th:value="${variable.id}" id="id" name="id"/>
						<div class="form-group form-control-medium">
							<label for="itemName">变量名：</label>
							<input id="itemName" name="itemName" type="text" th:value="${variable.itemName}" class="form-control"/>
						</div>
						<div class="form-group form-control-medium">
							<label for="info">描述：</label>
							<input id="info" name="info" type="text" th:value="${variable.info}" class="form-control"/>
						</div>
						<div class="form-group form-control-medium">
							<label for="groupId">组：</label>
							<input id="groupId" name="groupId" type="text" th:value="${variable.groupId}" class="form-control"/>
						</div>
						<div class="form-group form-control-medium">
							<label for="value">变量值：</label>
							<input id="value" name="value" type="text" th:value="${variable.value}" class="form-control"/>
						</div>
						<div class="form-btn-group-left">
			            	<button type="submit" class="btn btn-info">保存</button>
			            </div>
					</form>
				</div>
			</section>
		</div>
	</div>
	<script src="/resource/js/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="/resource/js/jQueryMessage/js/jquery.plugin.message.js"></script>
        <script type="text/javascript" th:inline="javascript">
	   	/* 保存方法 */
	    function validateForm(){
	    	var itemName = $("#itemName").val();
	    	if(itemName == null || itemName==''){
	    		$("body").MessageBox({
					type: 'error',
					message:'变量名称不能为空！',
					timeout:3000,
					callbak:null
				});
	    		return false;
	    	}
	    	return true;
	    }
    </script>
</body>
</html>
